import {defineStore} from 'pinia'
import {ref} from "vue";
export function toStore(){
    let store
    if(localStorage.getItem("store")!=undefined&&localStorage.getItem("store")!=""){
        store=JSON.parse(localStorage.getItem("store"))
    }else {
        const useCounterStore= defineStore('cache',{
            state:()=>{
                return{token:'',applicationName:'河北博软科技'}
            }
        })
        let store=useCounterStore()
        store.$subscribe((mutation, state)=>{
            localStorage.setItem("store",JSON.stringify(store))
        })
        return store;
    }
    return store
}